package cn.btks.resultintegration.rule.controller;

import cn.btks.commonserver.result.ResultState;
import cn.btks.commonserver.result.StateInfo;
import cn.btks.resultintegration.rule.pojo.IndustrialPark;
import cn.btks.resultintegration.rule.pojo.IndustrialStructureCategory;
import cn.btks.resultintegration.rule.service.IndustrialStructureCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author lijun
 * @Date 2021/2/19 11:05
 */
@RestController
@RequestMapping("api/v1.0/resultIntegration/rule")
@Api(tags = "规则模块")
@Validated
public class IndustrialStructureCategoryController {

    @Autowired
    IndustrialStructureCategoryService industrialStructureCategoryService;

    @GetMapping("/industrialStructureCategory/findAllIndustrialStructureCategory")
    @ApiOperation("查询所有产业结构调整指导目录的禁止类（产业结构调整指导目录-大类）")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "token", value = "token密匙", required = true, dataType = "string")
    })
    public ResultState findAllIndustrialStructureCategory() {
        List<IndustrialStructureCategory> industrialStructureCategoryList = industrialStructureCategoryService.findAllIndustrialStructureCategory();
        return industrialStructureCategoryList != null ? new ResultState(StateInfo.FIND_OK.getCode(),
                StateInfo.FIND_OK.getMsg(), industrialStructureCategoryList) : new ResultState(StateInfo.FIND_NULL.getCode(),
                StateInfo.FIND_NULL.getMsg());
    }
}
